<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="java.io.*,java.sql.*,InvestmentPojo.*,java.text.DateFormat,java.text.SimpleDateFormat,java.util.Calendar,java.util.Date,java.util.List,java.text.DateFormat,ImmovableIndia.serviceManagerImpl" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Investment gateways</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
</head>
<% 

String serviceName = null != request.getAttribute("showServiceName")? request.getAttribute("showServiceName").toString():"";
String UserIDForservice = null != request.getAttribute("UserIDForservice")?(String)request.getAttribute("UserIDForservice"):"";
List li = null != request.getAttribute("returnList")?(List) request.getAttribute("returnList"):null; 

String headerTitle = (null != request.getAttribute("headerTitle") && !"".equals(request.getAttribute("headerTitle")))?(String)request.getAttribute("headerTitle"):"CIRCULARS";

String name = "";
Date dateNow = null;
long days=0;
Calendar cal = Calendar.getInstance();
serviceManagerImpl smp= new serviceManagerImpl();
String DATE_FORMAT_NOW = "yyyyMMdd";
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);

String image = "";
%>
<body>
<%if("4".equals(UserIDForservice)){ %>

		<table width='100%' align='center' border='0' style='float:center !important;' class='TBFORM' cellspacing ='0' cellpadding='0' valign='center'>
		  <tr align='center' class ='TITLEFORM'><td colspan='5'><font style='font-family:Verdana, Arial, Helvetica, sans-serif;font-size:18px'valign='center' color='white'><b>CIRCULARS - <%=headerTitle.split("~~")[2] %></b></font></TD></TR>
		 
		  <tr><td class='THFont' width='5%'>Sr No</td><td class='THFont' width='10%'>Circular No</td><td class='THFont' width='18%'>Date of Circular</td><td class='THFont' width='67%'>Summary</td></tr>
		<%   if(li.isEmpty()){ %>
			  <tr><td width='100%' colspan='5' class='PH1' align='center'><font class='textFont' !important;>*** THERE ARE NO RECORDS AVILABLE FOR THIS SECTION ***</font></td></tr>
		 <% }  %>
 		  <tr><td colspan='5'>
		 <%  if(li.size() > 10){  %>
			  <table width='100%' style='height: 300px; overflow-y: auto; display: block;'>
		<%	  }else{  %>
			  <table width='100%'>
		  <%} if(null != li){ int index=1;
		  for(int i=0;i<li.size();i++){
			  circularsPojo obj = (circularsPojo)li.get(i);
			  dateNow = new Date(obj.getCreatedDate());
			  days=smp.calculateDays(dateNow,cal.getTime());
			  if(days <= 129){
					image="<img alt='*' src='images/new.gif'/>";
			  }else { 
					image="";
			} if(UserIDForservice.equals("4") && "Deposits".equals(obj.getType())){ %>
				   
			  <tr onmouseover="style.backgroundColor='#ebe7e4'" onmouseout="style.backgroundColor=''" bgcolor='<%=index % 2 == 0 ? "#F4FFFF" : "white" %>'><td width='5%' class='PH1'><font class='textFont'!important;><%=index %></font></td><td width ='10%' class='PH1'>
			  <a style="color: blue; text-decoration: none; border-bottom: 1px solid green;"; href='http://www.investmentgateways.com/CIRCULARS/<%=sdf.format(dateNow)%> CIR <%=obj.getTopic()%>.pdf' target='_blank'><%=obj.getTopic() %></a><%=image %></td><td width='18%' class='PH1'><font class='textFont' !important;><%=obj.getCreatedDate() %></font></td><td width='67%' class='PH1'><font class='textFont' !important;><%=obj.getCircular_subject() %></font></td></tr>
		  <% index++;
		  }}} %>
		  </table></td></tr>
		  </table>
		<br> 
		
 
		<table width='100%' align='center' border='0' style='float:center !important;' class='TBFORM' cellspacing ='0' cellpadding='0' valign='center'>
		  <tr align='center' class ='TITLEFORM'><td colspan='5'><font style='font-family:Verdana, Arial, Helvetica, sans-serif;font-size:18px'valign='center' color='white'><b>CIRCULARS<%="Rupee".equals(headerTitle.split("~~")[1]) ? " - Rupee Loans" : "" %></b></font></TD></TR>
		 
		  <tr><td class='THFont' width='5%'>Sr No</td><td class='THFont' width='10%'>Circular No</td><td class='THFont' width='18%'>Date of Circular</td><td class='THFont' width='67%'>Summary</td></tr>
		<%   if(li.isEmpty()){ %>
			  <tr><td width='100%' colspan='5' class='PH1' align='center'><font class='textFont' !important;>*** THERE ARE NO RECORDS AVILABLE FOR THIS SECTION ***</font></td></tr>
		 <% }  %>
 		  <tr><td colspan='5'>
		 <%  if(li.size() > 10){  %>
			  <table width='100%' style='height: 300px; overflow-y: auto; display: block;'>
		<%	  }else{  %>
			  <table width='100%'>
		  <%} if(null != li){ 
			  int index = 1;
		  for(int i=0;i<li.size();i++){
			  circularsPojo obj = (circularsPojo)li.get(i);
			  dateNow = new Date(obj.getCreatedDate());
			  days=smp.calculateDays(dateNow,cal.getTime());
			  if(days <= 129){
					image="<img alt='*' src='images/new.gif'/>";
			  }else { 
					image="";
			  }
			 
			  if(UserIDForservice.equals("4") && "Rupee".equals(obj.getType())){ 
			  %>
			  <tr onmouseover="style.backgroundColor='#ebe7e4'" onmouseout="style.backgroundColor=''" bgcolor='<%=index % 2 == 0 ? "#F4FFFF" : "white" %>'><td width='5%' class='PH1'><font class='textFont'!important;><%=index %></font></td><td width ='10%' class='PH1'>
			  <a style='color: blue; text-decoration: none; border-bottom: 1px solid green;' href='http://www.investmentgateways.com/CIRCULARS/<%=sdf.format(dateNow)%> CIR <%=obj.getTopic()%>.pdf' target='_blank'>
			  <%=obj.getTopic() %></a><%=image %></td><td width='18%' class='PH1'><font class='textFont' !important;><%=obj.getCreatedDate() %></font></td><td width='67%' class='PH1'><font class='textFont' !important;><%=obj.getCircular_subject() %></font></td></tr>
		  <% index++;
		  } } }%>
		  </table></td></tr>
		  </table>
		  
		<%}else { %>
				<table width='100%' align='center' border='0' style='float:center !important;' class='TBFORM' cellspacing ='0' cellpadding='0' valign='center'>
		  <tr align='center' class ='TITLEFORM'><td colspan='5'><font style='font-family:Verdana, Arial, Helvetica, sans-serif;font-size:18px'valign='center' color='white'><b>CIRCULARS</b></font></TD></TR>
		 
		  <tr><td class='THFont' width='5%'>Sr No</td><td class='THFont' width='10%'>Circular No</td><td class='THFont' width='18%'>Date of Circular</td><td class='THFont' width='67%'>Summary</td></tr>
		<%   if(li.isEmpty()){ %>
			  <tr><td width='100%' colspan='5' class='PH1' align='center'><font class='textFont' !important;>*** THERE ARE NO RECORDS AVILABLE FOR THIS SECTION ***</font></td></tr>
		 <% }  %>
 		  <tr><td colspan='5'>
		 <%  if(li.size() > 10){  %>
			  <table width='100%' style='height: 600px; overflow-y: auto; display: block;'>
		<%	  }else{  %>
			  <table width='100%'>
		  <%} if(null != li){ 
		  for(int i=0;i<li.size();i++){
			  circularsPojo obj = (circularsPojo)li.get(i);
			  dateNow = new Date(obj.getCreatedDate());
			  days=smp.calculateDays(dateNow,cal.getTime());
			  if(days <= 129){
					image="<img alt='*' src='images/new.gif'/>";
			  }else { 
					image="";
			}  %>
			  <tr onmouseover="style.backgroundColor='#ebe7e4'" onmouseout="style.backgroundColor=''" bgcolor='<%=i % 2 == 0 ? "#F4FFFF" : "white" %>'><td width='5%' class='PH1'><font class='textFont'!important;><%=i+1 %></font></td><td width ='10%' class='PH1'>
			  <a style='color: blue; text-decoration: none; border-bottom: 1px solid green;' href='http://www.investmentgateways.com/CIRCULARS/<%=sdf.format(dateNow)%> CIR <%=obj.getTopic()%>.pdf' target='_blank'>
			  <%=obj.getTopic() %></a><%=image %></td><td width='18%' class='PH1'><font class='textFont' !important;><%=obj.getCreatedDate() %></font></td><td width='67%' class='PH1'><font class='textFont' !important;><%=obj.getCircular_subject() %></font></td></tr>
		  <% } } %>
		  </table></td></tr>
		  </table>
		</body>
		<%} %>
<script>document.getElementById("loadingwait").style.display="none";</script>
